package com.heima.admin.controller;

import com.heima.admin.service.AdminChannelService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.pojos.wemedia.WmChannel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:频道
 * Author: Wzh
 * Date: 2024/8/3
 */
@RestController
@RequestMapping("/api/v1/channel")
@Slf4j
public class AdminChannelController {


    @Autowired
    private AdminChannelService adminChannelService;

    /**
     * 加载所有频道
     *
     * @return
     */
    @GetMapping("channels")
    public ResponseResult channels(){
        List<WmChannel> list = adminChannelService.list();
        return ResponseResult.okResult(list);
    }
}

